﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Common.MVVM.Core.Base;
using D2.Pathfinder.Data;
using System.Collections.ObjectModel;

namespace D2.PathfinderHub.ViewModel
{
    public class CharacterManagerViewModel : ViewModelBase<Settings>
    {
        public CharacterManagerViewModel(Settings model)
        {
            Model = model;
        }

        public ObservableCollection<CharacterSheetViewModel> Characters
        {
            get
            {
                if (_Characters == null)
                {
                    _Characters = SetUpObservableCollection<CharacterSheetViewModel, Character>(Model.Characters, (m) => { return new CharacterSheetViewModel((Character)m, this); });
                }
                return _Characters;
            }
        }
        private ObservableCollection<CharacterSheetViewModel> _Characters;

        public IEnumerable<AlignmentViewModel> Alignments
        { get { return SettingsManager.Lists[typeof(AlignmentViewModel)].Values.ToArray<object>().Cast<AlignmentViewModel>(); } }
    }
}
